package com.tfswx.jcyw.sqlmodel.gic;

import com.tfswx.jcyw.sqlmodel.api.Operator;
import com.tfswx.jcyw.sqlmodel.api.SqlModelFactory;
import com.tfswx.jcyw.sqlmodel.api.executor.Executor;
import com.tfswx.jcyw.sqlmodel.api.function.*;
import com.tfswx.jcyw.sqlmodel.gic.executor.DefaultExecutor;
import com.tfswx.jcyw.sqlmodel.gic.function.DefaultIf;
import com.tfswx.jcyw.sqlmodel.gic.function.DefaultInclude;
import com.tfswx.jcyw.sqlmodel.gic.function.DefaultSumAndIf;
import com.tfswx.jcyw.sqlmodel.gic.function.DefaultToNumber;
import com.tfswx.jcyw.sqlmodel.gic.operators.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 张述江
 * @date 2023/9/13
 */
public class DefaultSqlModelFactory implements SqlModelFactory {
    @Override
    public Executor createExecutor() {
        return new DefaultExecutor();
    }

    @Override
    public List<RuntimeFuntion> createFunctionList() {
        List<RuntimeFuntion> functionList = new ArrayList<>();
        functionList.add(new DefaultIf());
        functionList.add(new DefaultInclude());
        functionList.add(new DefaultSumAndIf());
        functionList.add(new DefaultToNumber());
        return functionList;
    }

    @Override
    public List<Operator> createOperatorList() {
        List<Operator> operatorList = new ArrayList<>();
        operatorList.add(new DefaultFilterOperator());
        operatorList.add(new DefaultGroupOperator());
        operatorList.add(new DefaultInputOperator());
        operatorList.add(new DefaultJoinOperator());
        operatorList.add(new DefaultOrderOperator());
        operatorList.add(new DefaultReplaceOperator());
        operatorList.add(new DefaultSplitOperator());
        operatorList.add(new DefaultUnionOperator());
        return operatorList;
    }
}
